package console;

import java.io.*;
import javax.swing.JOptionPane;
import javax.swing.ImageIcon;
import java.net.URL;
import java.net.MalformedURLException;
import console.manager.TaskManager;

public class Utilities {
	public static ImageIcon loadIcon(String imageName) {
		java.net.URL iconURL = ClassLoader.getSystemResource(("icons/"+imageName));
		return (new ImageIcon(iconURL));
	}
    public static String changeExtension(String name,String ext) {
        int lastDot = name.lastIndexOf(".");
        if(lastDot != -1) {
            return name.substring(0,lastDot) + ext;
        } else {
            return name + ext;
        }
    }
}
